From b545cf4fb2f9246b4dd50353e8018c2d66b9b3f7 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 23 Jul 2010 17:06:16 +0100 Subject: [PATCH] libxl: remove xenstore /local/domain/ after reading /vm and /vss paths On domain destroy libxl currently tries to find the /vm/ and /vss/ paths by reading /local/domain//{vm,vss} but does so after removing /local/domain/ which isn't much use. Also construct the xenstore path in destroy the same way as in create. It's not wrong but I had to look twice to check they were doing the same thing. Signed-off-by: Ian Campbell Acked-by: Stefano Stabellini Committed-by: Ian Jackson --- tools/libxl/libxl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 07989ece74..f064e10caf 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -773,19 +773,20 @@ int libxl_domain_destroy(struct libxl_ctx *ctx, uint32_t domid, int force) } if (libxl_devices_destroy(ctx, domid, force) < 0) XL_LOG(ctx, XL_LOG_ERROR, "libxl_destroy_devices failed for %d", domid); - if (!xs_rm(ctx->xsh, XBT_NULL, dom_path)) - XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", dom_path); - vm_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "/local/domain/%d/vm", domid)); + vm_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "%s/vm", dom_path)); if (vm_path) if (!xs_rm(ctx->xsh, XBT_NULL, vm_path)) XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vm_path); - vss_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "/local/domain/%d/vss", domid)); + vss_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "%s/vss", dom_path)); if (vss_path) if (!xs_rm(ctx->xsh, XBT_NULL, vss_path)) XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vss_path); + if (!xs_rm(ctx->xsh, XBT_NULL, dom_path)) + XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", dom_path); + xapi_path = libxl_sprintf(ctx, "/xapi/%u", domid); if (xapi_path) if (!xs_rm(ctx->xsh, XBT_NULL, xapi_path)) -- 2.30.2